/*
 * Packet.h
 *
 *  Created on: Dec 21, 2011
 *      Author: dzm
 */

#ifndef PACKET_H_
#define PACKET_H_

#include <iostream>
#include <QString>
#include <QStringList>

#include "Node.h"
#include "Header.h"

class Packet {
public:
	Packet();
	virtual ~Packet();
	void set(int num_of_unicast_turn,int num_of_multicast_turn, int num_of_des, int overlap, int seg , int hop);
	bool packetInitialize(QString , QString , QString);
	//排列节点顺序
	void sequence(QString , QString , QString);
	//QString坐标转为int数组
	int* QString2Co( QString );
	//计算转发出口
	int caculateOutport(int*, int* , int , int , int , int & ,bool &);
	int caculateOutport(int*, int , int & ,bool &);
	bool HandleMulticast(int& remain_num_of_multicast_turn,int* inport,int& count,int& index_of_pointer);

	int** seqCo;
	int *source;
	unsigned short *inport;

	Header header;
	QString nextHeader;
	QString initNode; // 始发节点的信息
	QString fileName;
	QByteArray load;
};

#endif /* PACKET_H_ */
